from django.db import models

# Create your models here.
from area.models import Area


class School(models.Model):
    IS_ACTIVE = [
        (0,'无效'),
        (1,'有效')
    ]
    school_name = models.CharField(max_length=225, verbose_name='学校名称', help_text='学校名称')
    school_url = models.CharField(max_length=225, verbose_name='学校url', help_text='学校url')
    area = models.ForeignKey(Area,on_delete=models.CASCADE,verbose_name='所属赛区',help_text='所属赛区',blank=True,null=True)
    is_active = models.IntegerField(choices=IS_ACTIVE,default=1)

    class Meta:
        verbose_name = "补给校区"
        verbose_name_plural = verbose_name
        ordering = ['-id']

    def __str__(self):
        return self.school_name